package cn.edu.fudan.DistanceMeasure;

import java.util.List;

/**
 * Created by 80494 on 2017/5/18.
 * haven't tested
 */
public class ED {
    //tested
        public static Double calldistance(List<Double> A, List<Double> B){
        if (A.size()!=B.size() || A.size()==0|| B.size()==0 ){
            System.out.println("The length of A and B is not equal ，or A's size is 0 ,or B's size is 0.");
            return -1.0;
        }
        double sum =0.0;
        for(int i=0;i<A.size();i++){
            sum += (A.get(i)-B.get(i))*(A.get(i)-B.get(i));
        }
        sum = Math.sqrt(sum);
        return sum;
    }
}
